import {alert} from "../../components/common/alert";

import {get, post} from "../../utils/req";

export async function regInfo(cat, code) {
    try {
        return await get(`/reg_info?cat=${cat}&code=${code}`);
    } catch (e) {
        return null;
    }
}

export async function register(data) {
    try {
        await post('/register', data);
        return true;
    } catch (e) {
        alert(`注册失败：${e}`, "error");
        return false;
    }
}
